package mulegame;

import static org.junit.Assert.*;

import org.junit.Test;

public class TileTest {

	// test placeMule() in Tile on a M1 terrain with a Food Mule
	// tests whether method returns true
	// tests if imagePath for tile image was properly updated
	@Test
	public void testPlaceFoodMule() {

		Tile t = new Tile(TileType.M1);
		Mule m = Mule.FOOD;
		
		String expectedImagePath = "src/mulegame/Images/M1FT.jpg";
		
		assertTrue("should return True if placement successful", t.placeMule(m));
		
		assertEquals("imagepath to the image of Tile should be updated", expectedImagePath, t.getImagePath());
		
	}
	
	// test placeMule() in Tile on a M1 terrain with a Energy Mule
	// tests whether method returns true
	// tests if imagePath for tile image was properly updated
	@Test
	public void testPlaceEnergyMule() {

		Tile t = new Tile(TileType.M1);
		Mule m = Mule.ENERGY;
		
		String expectedImagePath = "src/mulegame/Images/M1ET.jpg";
		
		assertTrue("should return True if placement successful", t.placeMule(m));
		
		assertEquals("imagepath to the image of Tile should be updated", expectedImagePath, t.getImagePath());
		
	
	}
	
	// test placeMule() in Tile on a M1 terrain with a Ore Mule
	// tests whether method returns true
	// tests if imagePath for tile image was properly updated
	@Test
	public void testPlaceOreMule() {

		Tile t = new Tile(TileType.M1);
		Mule m = Mule.ORE;
		
		String expectedImagePath = "src/mulegame/Images/M1BT.jpg";
		
		assertTrue("should return True if placement successful", t.placeMule(m));
		
		assertEquals("imagepath to the image of Tile should be updated", expectedImagePath, t.getImagePath());	
	}
	
	// test placeMule() in Tile on a River terrain with a Ore Mule
	// tests whether method returns true
	// tests if imagePath for tile image was properly updated
	@Test
	public void testPlaceOreMuleOnRiver() {

		Tile t = new Tile(TileType.RIVER);
		Mule m = Mule.ORE;
		
		String expectedImagePath = "src/mulegame/Images/R1BT.jpg";
		
		assertTrue("should return True if placement successful", t.placeMule(m));
		
		assertEquals("imagepath to the image of Tile should be updated", expectedImagePath, t.getImagePath());	
	}
	
	
	// test placeMule() in Tile on a M3 terrain with a Ore Mule
	// tests whether method returns true
	// tests if imagePath for tile image was properly updated
	@Test
	public void testPlaceFoodMuleOnM3() {

		Tile t = new Tile(TileType.M3);
		Mule m = Mule.FOOD;
		
		String expectedImagePath = "src/mulegame/Images/M3FT.jpg";
		
		assertTrue("should return True if placement successful", t.placeMule(m));
		
		assertEquals("imagepath to the image of Tile should be updated", expectedImagePath, t.getImagePath());	
	}
}
